<%-- 
    Document   : clientes
    Created on : 05/09/2011, 13:09:59
    Author     : Bruno
--%>

<%@page import="br.com.clicarros.dominio.cliente.Cliente"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        
    </head>
    <body>
        <jsp:include page="../topo.jsp" flush="true"></jsp:include>
        ${mensagem}
        
    <form name="form1" action="ControleCliente" method="post"> 
        <input type="submit" class="cancelar" name="excluir" value="Excluir" tabindex="2" /> 
         <a href="Administrador/cliente/CadastroCliente.jsp">Novo Cliente</a>
           
        <table padding="5px" width="100%" class="bordasimples">
          <tr align="center" bgcolor="#cccccc" >
                    <td ></td>
                    <td width="10%"> Nome </td>
                    <td width="25%"> Sobrenome </td>
                    <td width="20%"> E-mail</td>
                    <td width="15%"> Telefone </td>
                    <td width="15%"> CPF </td>
                    <td></td>
         </tr>  
         
         <tr align="center" bgcolor="#cccccc" >
                    <td></td>
                    <td> <input type="text" class="pequisa"name="nome"> </td>
                    <td> <input type="text"class="pequisa" name="sobrenome"> </input> </td>
                    <td> <input type="text" class="pequisa"name="email"> </input> </td>
                    <td> <input type="text" class="pequisa"name="telefone"> </input> </td>
                    <td> <input type="text" class="pequisa"name="cpf"> </input> </td>
                    <td> <input type="submit" name="filtrar" class="enviar" value="Pesquisar" tabindex="1"> </input></td>
         </tr>
         
                <%
                    List clientes = (List) request.getAttribute("clientes");
                    for(Object c : clientes) {
                        Cliente cliente = (Cliente)c;
                %>
                <tr align="center" bgcolor="#F5F5F5">
                    <td><input type="checkbox" class="checkbox" name="id" value="<%= cliente.getIdCliente() %>" /></td>
                    <td><%= cliente.getNome() %></td>
                    <td><%= cliente.getSobrenome() %></td>
                    <td><%= cliente.getEmail() %></td>
                    <td><%= cliente.getTelefone() %></td>
                    <td><%= cliente.getCpf() %></td>
                    <td><a href="ControleCliente?editar=<%= cliente.getIdCliente() %>"><img src="imagens/editar.png" alt="editar" title="editar" /></a></td>
                </tr>
                <%
                    } // fim do for.
                %>
        </table> 
        </form>
    </body>
</html>
